import 'package:flutter/material.dart';
import 'package:hkzf/widgets/common_image.dart';

import 'index_recommend_data.dart';

const TextStyle textstyle =
    TextStyle(fontSize: 14, fontWeight: FontWeight.w500);

class IndexRecommondItemWidget extends StatelessWidget {
  const IndexRecommondItemWidget({Key key, this.data}) : super(key: key);
  final IndexRecommendItem data;
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        Navigator.pushNamed(context, data.navigatorUri);
      },
      child: Container(
        padding: EdgeInsets.all(10),
        child:
            Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
          Column(
            children: [
              Text(
                data.title,
                style: textstyle,
              ),
              Text(
                data.content,
                style: textstyle,
              ),
            ],
          ),
          CommonImage(
            data.imageUri,
            width: 55,
          )
        ]),
      ),
    );
  }
}
